

<template>

  <div class="goodsItem dd-row dd-v-center  " style="padding:5pt 10pt;">
    <div class='left dd-column dd-h-center dd-v-center'>
      <div class='picdiv dd-row dd-v-center'>
        <img class="pic" :src=" !!item.pic ? item.pic : '/assets/img/food.png'" alt="具体参数" />
      </div>
    </div>
    <div class="right dd-column">
      <div class="dd-row dd-v-center">
        <div class="name">{{item.name}}</div>
        <div class="stock">库存· {{item.inventory}}</div>
      </div>
      <div class=" dd-elepisis intro">{{item.intro}}</div>
      <div class="priceAndNum dd-row dd-h-2side dd-v-center">
        <div class="price">￥ {{item.price}}</div>
        <Number :id="item.id" :num="item.num" @changeTm="changeTm($event)"></Number>
      </div>
    </div>
  </div>
</template>
<script>
import Number from "@/components/scanGoods/Number";
// import PopIntro from "@/components/PopIntro.vue";
export default {
  props: ["item","id"],
  data() {
    return {
      tm: this.AllData.totalMoney
    };
  },
  methods: {
    detail(_son) {
      this.$emit("ffclose", _son);
    },
    /* 改变总钱数 */
    changeTm(_tm) {
      console.log("goodsItem.vue-中的-->");
      this.$emit("changeTm", _tm);
    }
  },
  components: {
    Number
  }
};
</script>
<style scoped>
/* goodsItem */

.goodsItem {
  z-index: 100;
  background: #fff;
  margin: 5pt 0;
}

.goodsItem .left .picdiv {
  width: 50pt;
  height: 50pt;
  border-radius: 5pt;
  box-sizing: border-box;
  box-shadow: 0 0 5pt #ccc;
}
.goodsItem .left .picdiv .pic {
  width: 50pt;
  height: 50pt;
}
/* 商品名字 */
.goodsItem .right .name {
  color: #000;
  font-size: 12pt;
  font-weight: bold;
}

/* 库存 */

.goodsItem .stock {
  margin-left: 10pt;
  border-radius: 5pt 5pt 5pt 0;
  padding: 0pt 3pt;
  color: #000;
  background: #f8c700;
  font-size: 10pt;
  height: 14pt;
  line-height: 14pt;
}
/* →_→右边 */
.goodsItem .right {
  color: #fff;
  font-size: 12pt;
  margin-left: 10pt;
  flex: 1;
}

.goodsItem .right .intro {
  color: #000;
  font-size: 10pt;
  margin-top: 5pt;
}
.goodsItem .right .price {
  font-size: 12pt;

  font-weight: bold;
  color: #000;
}

/* 钱数和件数 */
.goodsItem .right .priceAndNum {
  /* margin-top: 2pt; */
  height: 24pt;
  display: flex;
  flex-direction: row;
  align-items: center;
}
</style>


